#include"SList.h"

void SListTest01()
{
	SLTNode* plist = NULL;

	SListPushBack(&plist, 1);
	SListPushBack(&plist, 20);
	SListPushBack(&plist, 30);
	SListPopBack(&plist);
	SListPopBack(&plist);
	
	SListPushFront(&plist, 10);
	SListPushFront(&plist, 20);
	SListPushFront(&plist, 30);
	/*SListPushFront(&plist, 20);
	SListPushFront(&plist, 30);*/


	SListPrint(plist);
}


void SListTest02()
{
	SLTNode* plist = NULL; 
	SListPushFront(&plist, 10);
	SListPushBack(&plist, 20);
	SListPushBack(&plist, 30);


	SLTNode*ret=SListFind(plist, 20);
	SListInsertAfter(ret, 200);
	SListInsertAfter(plist, 100);


	
	

	SListPrint(plist);
	SListEraseAfter(&plist, ret);
	SListPrint(plist);

	SListDestroy(&plist);
}

void SListTest03()
{
	SLTNode* plist = NULL;
	SListPushFront(&plist, 10);
	SListPushBack(&plist, 20);
	SListPushBack(&plist, 30);

	SListDestroy(&plist);

}


void SListTest04()
{
	SLTNode* plist = NULL;
	SListPushBack(&plist, 10);
	SListPushBack(&plist, 20);
	SListPushBack(&plist, 30);
	SLTNode* ret = SListFind(plist, 20);
	SLTInsert(&plist, ret, 200);
	SListPrint(plist);


	SListDestroy(&plist);

}

int main()
{
	//SListTest01();
	//SListTest02();
	//SListTest03();
	SListTest04();
	return 0;
}